export const getModules = (modulesFiles) => {
  const modules = modulesFiles.keys().reduce((modules, modulePath) => {
    const moduleName = modulePath
      .replace(/^\.\/(.*)\.\w+$/, "$1")
      .replace("base/", "")
      .replace("basic/", "")
      .replace("backup/", "")
      .replace("business/", "")
      .replace("cus-form/", "")
      .replace("/index", "");
    const value = modulesFiles(modulePath);
    modules[moduleName] = value.default;
    return modules;
  }, {});
  return modules;
};
